package cn.wolfcode.query;

import cn.wolfcode.util.StringUtil;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class QueryObject {

    //关键字
    private String keyword;

    //当前页
    private int currentPage = 1;
    //每页显示条数
    private int pageSize = 3;

    //当前页开始的索引
    public int getStartIndex(){
        return (currentPage-1)*pageSize;
    }

    public String getKeyword(){
        return StringUtil.hasLength(keyword) ? keyword : null;
    }
}
